function showLearningCurves(expNrs, runs, opponents, showInfo, showAllData, nBars)
    if(nargin < 2), runs = 1:10;  end % default: summarise all data
    if(nargin < 3), opponents = 1; end
    if(nargin < 4), showInfo = true; end
    if(nargin < 5), showAllData = false; end % only show mean and std.dev.
    if(nargin < 6), nBars = 10; end % number of bars in plot
        
    if(showInfo)
        getExperimentInfo;
        labels = {experimentInfo{expNrs}};
    else 
        for k=1:length(expNrs); 
            labels{k} = sprintf('experiment %i',expNrs(k)); 
        end;
    end
    
    % make-up for plot
    Xlabel = 'training games';
    Ylabel = 'loss percentage';
    Title = {'learning curves', 'Network vs. Random and Positional'};
    FontSize = 15;
    Marker = {'o','x','+','s','*','d','v','^','<','>','p','h','o','x','+','s','*','d','v','^','<','>','p','h','o','x','+','s','*'};
    MarkerSize = 10;
    LineStyle = {'-','-.','-','-.',':','-.','-.',':','-','-.','-.',':','-','-.','-.',':','-','-.','-.',':','-','-.','-.',':','-'}; %yes, modulo is indeed better
    LineWidth = 3;
    Color      = {'r','b','k','m','c','g','y','r','b','k','m','c','g','y','r','b','k','m','c','g','y','r','b','k','m','c','g','y'};

    % consequences
    data_size =   nTrainingGames / test_interval;          % total test-data points
    xValuesAll = (1 : data_size) * nTrainingGames / data_size; %x values to all test-data
    idxs =    round([1 : data_size /nBars : data_size, data_size]);            % points from test-data to use
    xValues = [1 : nTrainingGames/nBars : nTrainingGames, nTrainingGames];   % corresponding x value
    factor = 100 / test_games;                             % to convert to percentages
    
    nExps = length(expNrs);
   
     %% create new figure
    figure;
    % go through each experiment
    for k=1:nExps;
        expNr = expNrs(k);
	hDataPlot(k) = hggroup; %place to group all plots for this exp --> needed for legend
        %loop over opponents
        for opp=opponents; 
            % look for learning curves to merge;
	    nRuns = 0; %counter, in case runs are missing
            for i=1:length(runs);
                run = runs(i);
                file = sprintf('exp%i.%i.out',expNr,run);
                if(exist( file, 'file'))
		    nRuns = nRuns + 1;
                    % load 3 columns per opponent from file; 
                    data_temp = load(file); %size(data_temp) = [data_size, 3 * #opponents]

                    % no merging yet, just collecting percentages;
                    % useful for error bars
                    data(nRuns, :) = data_temp(:, opp*3 - 1)*factor; %-2 = win, -1 = loss, -0 = draw
		else
		    disp(sprintf('run %i of exp %i is missing.',run,expNr));
                end
            end

            % calculate deviation columnwise; should give row vector
            % bars give interval of 68% of the data points
            deviation_data = sqrt(var(data)); 
            % merging: calculate mean columnwise; should give row vector
            mean_data = mean(data);

            % correct if only 1 run is available
            if(nRuns == 1)
               deviation_data = zeros(data_size,1);
               mean_data = data';
            end

            % plot result
	    if(nRuns > 0)
		if(showAllData)   
		    hold on,
			hData = plot(xValuesAll, data, [Marker{k}, Color{k}], 'LineWidth', LineWidth, 'MarkerSize', MarkerSize);
		    hold off,
		else
		    hold on,
			hData = errorbar(xValues, mean_data(idxs), deviation_data(idxs),  [Marker{k}, LineStyle{k}, Color{k}], 'LineWidth', LineWidth, 'MarkerSize', MarkerSize);	
		    hold off
		end
		set(hData , 'Parent', hDataPlot(k) ); % 
	    end
        end
        set(get(get(hDataPlot(k),'Annotation'),'LegendInformation'),'IconDisplayStyle','on'); 
    end
    
    % make-up:
    axis([-nTrainingGames*0.05, 1.05*nTrainingGames, 0, 100]);
    grid on
    legend(labels)
    set( xlabel(Xlabel), 'FontSize', FontSize );
    set( ylabel(Ylabel), 'FontSize', FontSize );
    set( title(Title),   'FontSize', FontSize );
end
